package com.zr.Inquiry.service.impl;

import com.zr.Inquiry.mapper.InquiryMapper;
import com.zr.Inquiry.pojo.LegalPersonVo;
import com.zr.Inquiry.meiju.CurrencyCodeEnum;
import com.zr.Inquiry.meiju.InquiryStatusEnum;
import com.zr.Inquiry.meiju.IsTaxEnum;
import com.zr.Inquiry.meiju.TypeEnum;
import com.zr.Inquiry.pojo.*;
import com.zr.Inquiry.service.InquiryService;
import com.zr.util.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.*;

/**
 * Created by Administrator on 2019/9/24.
 */
@Service
public class InquiryServiceImpl implements InquiryService {
    @Autowired
    private InquiryMapper inquiryMapper;

    @Override
    public ResultVo queryPage(InquirySelectVo inquirySelectVo) {
        //根据条件查询数据
        List<InquiryVo> inquiryVoList = inquiryMapper.queryData(inquirySelectVo);
        //根据条件查询数量
        int count = inquiryMapper.queryCount(inquirySelectVo);
        for (InquiryVo inquiryVo:inquiryVoList){
            inquiryVo.setTypeName(TypeEnum.getName(inquiryVo.getType()));
        }
        for (InquiryVo inquiryVo:inquiryVoList){
            inquiryVo.setInquiryStatusName(InquiryStatusEnum.getName(inquiryVo.getInquiryStatus()));
        }
        //把数据包装进allRecords
        AllRecords allRecords = new AllRecords();
        allRecords.setPageIndex(inquirySelectVo.getPageIndex());
        allRecords.setPageSize(inquirySelectVo.getPageSize());
        allRecords.resetTotalPage(count);
        allRecords.setTotalNumber(count);
        allRecords.setDataList(inquiryVoList);

        return ResultVoBuilder.success(allRecords);
    }

    @Override
    public ResultVo queryByLegalPerson(InquiryVo inquiryVo) {
        List<InquiryVo> partnerList = inquiryMapper.queryByLegalPerson(inquiryVo);
        return ResultVoBuilder.success(partnerList);
    }

    @Override
    public ResultVo querySpare(SpareSelectVo spareSelectVo) {
        //根据条件查询数据
        List<InquirySpareVo> inquirySpareVoList = inquiryMapper.queryDataBySpare(spareSelectVo);
        //根据条件查询数量
        int count = inquiryMapper.queryCountBySpare(spareSelectVo);
        //把数据包装进allRecords
        AllRecords allRecords = new AllRecords();
        allRecords.setPageIndex(spareSelectVo.getPageIndex());
        allRecords.setPageSize(spareSelectVo.getPageSize());
        allRecords.resetTotalPage(count);
        allRecords.setTotalNumber(count);
        allRecords.setDataList(inquirySpareVoList);
        return ResultVoBuilder.success(allRecords);
    }

    @Override
    public ResultVo querySupplier(SupplierSelectVo supplierSelectVo) {
        //根据条件查询数据
        List<InquirySupplierVo> spareVoList = inquiryMapper.queryDataBySupplier(supplierSelectVo);
        //根据条件查询数量
        int count = inquiryMapper.queryCountBySupplier(supplierSelectVo);
        //把数据包装进allRecords
        AllRecords allRecords = new AllRecords();
        allRecords.setPageIndex(supplierSelectVo.getPageIndex());
        allRecords.setPageSize(supplierSelectVo.getPageSize());
        allRecords.resetTotalPage(count);
        allRecords.setTotalNumber(count);
        allRecords.setDataList(spareVoList);
        return ResultVoBuilder.success(allRecords);
    }


    @Override
    @Transactional
    public ResultVo addInquiry(@Valid InquiryAddVo inquiryAddVo) {
        //验证
        ResultVo resultVo = validate(inquiryAddVo);
        if (!resultVo.getSuccess()){
            return resultVo;
        }
        //入库主表数据
        InquiryTotal inquiryTotal = new InquiryTotal();
        BeanUtils.copyProperties(inquiryAddVo,inquiryTotal);
        Date nowDate = new Date();
        inquiryTotal.setCreatorName("张三");
        inquiryTotal.setCreateTime(nowDate);
        inquiryTotal.setUpdateName("张三");
        inquiryTotal.setUpdateTime(nowDate);
        inquiryTotal.setRequestForQuotationId(UUID.randomUUID().toString());
        System.out.println("入库之前的id"+inquiryTotal.getId());
        inquiryMapper.addInquiryTotal(inquiryTotal);
        System.out.println("入库之后的id"+inquiryTotal.getId());
        //入库备件明细信息
        List<Inquirysparedetail> inquirysparedetailList = inquiryAddVo.getInquiryDetailsList();
        for (Inquirysparedetail inquirysparedetail:inquirysparedetailList){
            inquirysparedetail.setInquiryId(inquiryTotal.getId());
        }
        inquiryMapper.addInquirySparePartDetail(inquirysparedetailList);
        //入库供应商明细信息
        List<Inquirysupplierdetail> inquirysupplierdetailList= inquiryAddVo.getSupplierDetailsList();
        for (Inquirysupplierdetail inquirysupplierdetail:inquirysupplierdetailList){
            inquirysupplierdetail.setInquiryId(inquiryTotal.getId());
        }
        inquiryMapper.addInquirySupplierDetail(inquirysupplierdetailList);
        return ResultVoBuilder.success();
    }

    private ResultVo validate(@Valid InquiryAddVo inquiryAddVo) {

         /* 1.验证法人是否存在
        2.验证询价类型是否存在
        3.验证币别是否存在
        4.验证是否含税是否存在
        5.验证开始日期是否在结束日期之前*/
        ResultVo resultVo =  validateTotal(inquiryAddVo);
        if (!resultVo.getSuccess()){
            return resultVo;
        }
      /*  6.验证备件是否存在，并且提示那个备件已经存在了
        7.验证备件是否重复，并且提示那个备件重复了
        8.验证备件是否存在可以生产它的供应商，并且提示用户哪个供应商可以生产它
        9.验证询价数量是否为0
        10.验证供应商是否存在，并且提示那个供应商已经存在了
        11.验证供应商是否重复，并且提示那个供应商重复了
        12.验证供应商是否存在可以生产的备件，并且提示用户哪个备件它可以生产
        13.验证备件集合不能为空
        14.验证供应商集合不能为空*/
        ResultVo resultVo1 =  validateDetail(inquiryAddVo);
        if (!resultVo1.getSuccess()){
            return resultVo1;
        }

        return ResultVoBuilder.success();
    }

    private ResultVo validateDetail(@Valid InquiryAddVo inquiryAddVo) {
         /*
        6.验证备件是否重复，并且提示那个备件重复了
        7.验证备件是否存在，并且提示那个备件已经存在了
        8.验证备件是否存在可以生产它的供应商，并且提示用户哪个供应商可以生产它
        9.验证询价数量是否为0
        10.验证供应商是否重复，并且提示那个供应商重复了
        11.验证供应商是否存在，并且提示那个供应商已经存在了
        12.验证供应商是否存在可以生产的备件，并且提示用户哪个备件它可以生产
        13.验证备件集合不能为空
        14.验证供应商集合不能为空*/
        //备件集合
        List<Inquirysparedetail> inquirysparedetailList = inquiryAddVo.getInquiryDetailsList();
        List<String> codeList = new ArrayList<>();
        List<String> repeatCodeList = new ArrayList<>();
        List<String> repeatNewCodeList = new ArrayList<>();
        for (Inquirysparedetail inquirysparedetail:inquirysparedetailList){
            codeList.add(inquirysparedetail.getSpareCoding());
        }
        for (String code :codeList){
            if (repeatCodeList.contains(code)){
                repeatNewCodeList.add(code);
            }else {
                repeatCodeList.add(code);
            }
        }
        if (!repeatNewCodeList.isEmpty()){
            return ResultVoBuilder.error("存在重复的备件编码，重复的备件编码为:"+repeatNewCodeList);
        }
        //验证是否存在
        List<String> codes = inquiryMapper.querySparePartByCodeList(codeList);
        if (codes.size()!=codeList.size()){
            codeList.removeAll(codes);
            return ResultVoBuilder.error("不存在的备件编码为："+codeList);
        }

        //验证备件是否存在合法的供应商
        List<Inquirysupplierdetail> inquirysupplierdetailList = inquiryAddVo.getSupplierDetailsList();
        List<String> supplierCodeList = new ArrayList<>();
        for (Inquirysupplierdetail inquirysupplierdetail:inquirysupplierdetailList){
            supplierCodeList.add(inquirysupplierdetail.getVendorCode());
        }
        //1.现根据备件集合查询出这些备件对应的供应商信息
        List<SpareSupplier> spareSupplierList = inquiryMapper.querySpareSupplierByCodeList(codeList);
        for  (String code :codeList){
            //根据中间表找出的供应商集合
            List<String> vendorList = new ArrayList<>();
            for (SpareSupplier spareSupplier: spareSupplierList){
                if (code.equals(spareSupplier.getSpareCoding())){
                    vendorList.add(spareSupplier.getVendorCode());
                }
            }
            //判断是否存在交集，如果存在交集为false 不存在为true
            if (Collections.disjoint(supplierCodeList,vendorList)){
                return ResultVoBuilder.error("备件编码："+code+"不存在合法的供应商，它的合法供应商为："+vendorList);
            }
        }


        //供应商集合
        List<Inquirysupplierdetail> inquirysupplierdetailList1 = inquiryAddVo.getSupplierDetailsList();
        List<String> codeList1 = new ArrayList<>();
        List<String> repeatCodeList1 = new ArrayList<>();
        List<String> repeatNewCodeList1 = new ArrayList<>();
        for (Inquirysupplierdetail inquirysupplierdetail:inquirysupplierdetailList1){
            codeList1.add(inquirysupplierdetail.getVendorCode());
        }
        for (String code :codeList1){
            if (repeatCodeList1.contains(code)){
                repeatNewCodeList1.add(code);
            }else {
                repeatCodeList1.add(code);
            }
        }
        if (!repeatNewCodeList1.isEmpty()){
            return ResultVoBuilder.error("存在重复的供应商编码，重复的供应商编码为:"+repeatNewCodeList1);
        }
        //验证是否存在
        List<String> codes1 = inquiryMapper.querySupplierPartByCodeList(codeList1);
        if (codes1.size()!=codeList1.size()){
            codeList1.removeAll(codes1);
            return ResultVoBuilder.error("不存在的供应商编码为："+codeList1);
        }

        //验证供应商是否存在合法的备件
        List<Inquirysparedetail> inquirysparedetailList1 = inquiryAddVo.getInquiryDetailsList();
        List<String> spareCodeList = new ArrayList<>();
        for (Inquirysparedetail inquirysparedetail:inquirysparedetailList1){
            spareCodeList.add(inquirysparedetail.getSpareCoding());
        }
        //1.现根据供应商集合查询出这些供应商对应的备件信息
        List<SpareSupplier> spareSupplierList1 = inquiryMapper.querySupplierSpareByCodeList(codeList1);
        for  (String code :codeList1){
            //根据中间表找出的备件集合
            List<String> spareList = new ArrayList<>();
            for (SpareSupplier spareSupplier: spareSupplierList1){
                if (code.equals(spareSupplier.getVendorCode())){
                    spareList.add(spareSupplier.getSpareCoding());
                }
            }
            //判断是否存在交集，如果存在交集为false 不存在为true
            if (Collections.disjoint(spareCodeList,spareList)){
                return ResultVoBuilder.error("供应商编码："+code+"不存在合法的备件，它的合法备件为："+spareList);
            }
        }

        return ResultVoBuilder.success();
    }

    private ResultVo validateTotal(@Valid InquiryAddVo inquiryAddVo) {

        //1.验证法人是否存在,根据法人id查询法人表是否存在数据
        LegalPersonVo legalPersonVo =  inquiryMapper.queryLegalPersonById(inquiryAddVo.getLegalPersonId());
        if (legalPersonVo==null){
            return ResultVoBuilder.error("法人信息不存在！");
        }
        if (TypeEnum.getName(inquiryAddVo.getType())==null){
            return ResultVoBuilder.error("询价类型不存在！");
        }
        if (CurrencyCodeEnum.getName(inquiryAddVo.getCurrencyCode())==null){
            return ResultVoBuilder.error("询价币别不存在！");
        }
        int i = inquiryAddVo.getStartTime().compareTo(inquiryAddVo.getEndTime());
        //如果
        if (i>=0) {
            return ResultVoBuilder.error("开始日期必须在结束日期之前！");
        }
        return ResultVoBuilder.success();

    }

    @Override
    public ResultVo query(InquirySelectVo inquirySelectVo) {
        //根据条件查询数据
        InquiryVo inquiryVo = inquiryMapper.queryByInquirytotal(inquirySelectVo);
        List<Inquirysparedetail> inquiryVoListBySpare=inquiryMapper.queryByInquirysparedetail(inquirySelectVo);
        List<Inquirysupplierdetail> inquiryVoListBySupplier=inquiryMapper.queryByInquirysupplierdetail(inquirySelectVo);
        inquiryVo.setInquiryDetailsList(inquiryVoListBySpare);
        inquiryVo.setSupplierDetailsList(inquiryVoListBySupplier);
        inquiryVo.setTypeName(TypeEnum.getName(inquiryVo.getType()));
        inquiryVo.setIsTaxName(IsTaxEnum.getName(inquiryVo.getIsTax()));
        inquiryVo.setCurrencyCodeName(CurrencyCodeEnum.getName(inquiryVo.getCurrencyCode()));
        inquiryVo.setInquiryStatusName(InquiryStatusEnum.getName(inquiryVo.getInquiryStatus()));
        return ResultVoBuilder.success(inquiryVo);
    }

    @Override
    @Transactional
    public ResultVo modifyState(InquiryUpdateStatusVo inquiryUpdateStatusVo) {
        //验证要修改的数据是否存在
        InquiryVo inquiryVo = inquiryMapper.queryByrequestForQuotationId(inquiryUpdateStatusVo.getRequestForQuotationId());
        if (inquiryVo==null){
            return ResultVoBuilder.error("500","修改的数据不存在！");
        }
        //给修改人员和修改时间赋值
        InquiryVo inquiryVo1 = new InquiryVo();
        BeanUtils.copyProperties(inquiryUpdateStatusVo,inquiryVo1);
        inquiryVo1.setUpdateName("小明");
        inquiryVo1.setUpdateTime(new Date());
        inquiryMapper.modifyState(inquiryVo1);
        return ResultVoBuilder.success();
    }

    @Override
    public ResultVo importFile(MultipartFile file) {
        return null;
    }

   /*


    @Override
    public ResultVo importFile(MultipartFile file) throws Exception {
       *//* 1.给用户提供导入模板*//*
        //2.提示版本问题，询问产品经理支持哪种版本的导入格式，2007版本的导入模板，根据版本不同，poi导入技术的读取方式不同
        String fileName = file.getOriginalFilename();
        if (!fileName.contains("xlsx")) {
            return ResultVoBuilder.error("只能导入2007版本，以xlsx结尾的Excel文件");
        }
        //3.模板是否是需要导入的模板，验证模板是否正确  4.格式问题，必须保持统一格式，统一为字符串格式导入
        ResultVo<List<CorporateFactoryAddVo>> resultVo = validateFile(file);
        if (!resultVo.getSuccess()) {
            return resultVo;
        }
       *//*
        5.验证不为空字段是否为空
        6.验证字符长度是否符合需求*//*
        ResultVo<List<CorporateFactoryAddVo>> yanzheng = yanzheng(resultVo.getData());
        if (!yanzheng.getSuccess()) {
            return yanzheng;
        }
        //验证重复
        ResultVo<List> chongfu = chongfu(yanzheng.getData());
        if (!chongfu.getSuccess()) {
            return chongfu;
        }
        //7.验证数据是否存在也就是是否合法
        //入库
        ResultVo add = add(yanzheng.getData());
        if (!add.getSuccess()) {
            return add;
        }
        return null;
    }

    public ResultVo chongfu(List<CorporateFactoryAddVo> corporateFactoryAddVoList) {
        List<String> personCodeList = new ArrayList<>();
        List<String> plantCodeList = new ArrayList<>();
        for (CorporateFactoryAddVo corporateFactoryAddVo : corporateFactoryAddVoList) {
            personCodeList.add(corporateFactoryAddVo.getLegalPersonCode());
            plantCodeList.add(corporateFactoryAddVo.getLegalPlantCode());
        }
        List<String> newCodeList = new ArrayList<>();
        List<String> repeatCodeList = new ArrayList<>();
        for (String code : personCodeList) {
            if (newCodeList.contains(code)) {
                repeatCodeList.add(code);
            } else {
                newCodeList.add(code);
            }
        }
        if (!repeatCodeList.isEmpty()) {
            return ResultVoBuilder.error("没有要添加的法人编码，错误法人编码为:" + repeatCodeList.toString());
        }
        return ResultVoBuilder.success();

    }

    public ResultVo yanzheng(List<CorporateFactoryAddVo> corporateFactoryAddVoList) {
          *//*
        5.验证不为空字段是否为空
        6.验证字符长度是否符合需求
        7.验证数据是否存在也就是是否合法
        8.验证数据是否重复
        9.对于需要转换的数据进行数据转换，比如数据库存的数据为数字格式，用户输入的为汉字，需要把汉字转换为数字存储*//*


        for (CorporateFactoryAddVo corporateFactoryAddVo : corporateFactoryAddVoList) {
            if (StringUtils.isEmpty(corporateFactoryAddVo.getLegalPlantCode())) {
                return ResultVoBuilder.error("工厂编码不能为空！");
            } else {
                if (corporateFactoryAddVo.getLegalPlantCode().length() > 100) {
                    return ResultVoBuilder.error("工厂编码长度不能大于100字符！");
                }
            }
            //验证是否为合法汉字，如果合法，给状态值进行转换进行赋值。
            if (StatusEnum.getValue(corporateFactoryAddVo.getEnabledName()) == null) {
                return ResultVoBuilder.error("状态只能是启用和禁用！");
            } else {
                corporateFactoryAddVo.setEnabled(StatusEnum.getValue(corporateFactoryAddVo.getEnabledName()));
            }
//              }

        }
        return ResultVoBuilder.success(corporateFactoryAddVoList);

    }

    public ResultVo<List<CorporateFactoryAddVo>>    validateFile(MultipartFile file) throws Exception {
//        模板是否是需要导入的模板，验证模板是否正确
        //poi核心类，用来读取excel表格中的数据
        XSSFWorkbook workbook = new XSSFWorkbook(file.getInputStream());
        //获取单元格中的信息 at0是获取sheet1中的数据。
        XSSFSheet sheet = workbook.getSheetAt(0);
        System.out.println(sheet.getRow(sheet.getFirstRowNum()).getCell(0));
        //验证第一列第一行的表格标头信息是否为 “询价单导入”，如果不是，提示模板错误。
        if (!String.valueOf(sheet.getRow(sheet.getFirstRowNum()).getCell(0)).equals("法人工厂导入模板")) {
            return ResultVoBuilder.error("模板错误，请检查模板！", "500");
        }
        List<CorporateFactoryAddVo> inquirySpareDetailVoList = new ArrayList<>();
        //遍历excel表格中的所有数据，从第五行开始读取，没有数据时终止遍历。
        for (int i = sheet.getFirstRowNum() + 3; i <= sheet.getLastRowNum(); i++) {
            //读取每一行的数据
            XSSFRow xssfRow = sheet.getRow(i);
            if (xssfRow != null) {
                if (!String.valueOf(xssfRow.getCell(0)).equals("")
                        || !String.valueOf(xssfRow.getCell(1)).equals("")
                        || !String.valueOf(xssfRow.getCell(2)).equals("")
                        || !String.valueOf(xssfRow.getCell(3)).equals("")
                        ) {
                    //把每一行的数据放入到实体类中
                    CorporateFactoryAddVo inquiryImportVo = build(xssfRow);
                    //把实体类中的数据放入到list集合中
                    inquirySpareDetailVoList.add(inquiryImportVo);
                }

            }
        }
        return ResultVoBuilder.success(inquirySpareDetailVoList);
    }

    public CorporateFactoryAddVo build(XSSFRow xssfRow) {
        CorporateFactoryAddVo corporateFactoryAddVo = new CorporateFactoryAddVo();
//        try {
        corporateFactoryAddVo.setLegalPersonCode(String.valueOf(xssfRow.getCell(0)));
      *//*  }catch (Exception e){
            return ResultVoBuilder.error("编码格式只能为文本格式，请检查格式！");
        }*//*
        corporateFactoryAddVo.setLegalPlantCode(String.valueOf(xssfRow.getCell(1)));
        corporateFactoryAddVo.setLegalPlantDec(String.valueOf(xssfRow.getCell(2)));
        corporateFactoryAddVo.setEnabledName(String.valueOf(xssfRow.getCell(3)));
        return corporateFactoryAddVo;
    }

    public ResultVo assigement(List<CorporateFactoryAddVo> corporateFactoryAddVoList) {
        List<String> personCodeList = new ArrayList<>();
        List<String> plantCodeList = new ArrayList<>();
        for (CorporateFactoryAddVo corporateFactoryAddVo : corporateFactoryAddVoList) {
            personCodeList.add(corporateFactoryAddVo.getLegalPersonCode());
            plantCodeList.add(corporateFactoryAddVo.getLegalPlantCode());
        }

//        //验证数据库中是否存在法人编码
//        List<String> personCodes = corporateFactoryMapper.queryByPersonCodes(personCodeList);
////        codeList.removeAll(planClassCodes);
//        if (!personCodes.isEmpty()) {
//            return ResultVoBuilder.error("存在的法人编码为:" + personCodes);
//        }

        //验证数据库中是否存在工厂编码
        List<String> plantCodes = corporateFactoryMapper.queryByPlantCodes(plantCodeList);
//        nameList.removeAll(planClassNames);
        if (!plantCodes.isEmpty()) {
            return ResultVoBuilder.error("存在的工厂编码为:" + plantCodes);
        }

        return ResultVoBuilder.success();
    }

    @Override
    public ResultVo exportExcel(HttpServletResponse response, CorporateFactorySelectVo corporateFactorySelectVo)throws Exception {
        //1.定义一个导出模板
        //2.从数据库中查询出将要导出的数据
        //根据条件查询数量
        int count =  corporateFactoryMapper.queryCount(corporateFactorySelectVo);
        if (count>10000){
            return ResultVoBuilder.error("导出数据不能大于10000条，请选择条件在进行导出！");
        }
        //根据条件查询数据
        List<FactoryVo> factoryVoList = corporateFactoryMapper.queryDataExport(corporateFactorySelectVo);
        //对需要转化的数据进行转化
        for (FactoryVo factoryVo:factoryVoList){
            factoryVo.setEnabledName(StatusEnum.getName(factoryVo.getEnabled()));
        }
        //把从数据库中查询出的数据赋值给导出模板
        //获取响应输出流
        ServletOutputStream out = response.getOutputStream();
        //给输出文件设置名称
        POIClass.toPackageOs(response, "法人工厂导出");
        //读取模板中的数据
        InputStream in = ExportUtil.toPackageIn("templates/法人工厂导出模板.xlsx");

        //根据模板的数据、把查询出来的数据给摸版SHeet1组中的数据赋值、把excel输出到浏览器上
        writeDataToExcel(in, "Sheet1", factoryVoList, out);
        if (in != null) {
            in.close();
            out.close();
        }
        return null;
    }

    // 由于此方法不能通用, 所以单独写在这里
    private void writeDataToExcel(InputStream in, String sheetName, List<FactoryVo> factoryVoList, ServletOutputStream out) throws Exception {
        //POi读取模板
        XSSFWorkbook wb = new XSSFWorkbook(in);
        //读取sheet1中的数据
        Sheet sheet = wb.getSheet(sheetName);
        if (sheet != null) {
            //向sheet1中赋值，设置样式
            toResultListValueInfo(sheet, factoryVoList);
        }
        //把数据写入到输出流中
        wb.write(out);
        //关闭poi方法
        wb.close();
    }


    *//**
     * 插入excel表中项目信息
     *
     * @param sheet
     *//*
    private void toResultListValueInfo(Sheet sheet, List<FactoryVo> factoryVoList) {
        //从第4行开始赋值
        int row_column = 3;
        //遍历数据集合
        for (FactoryVo obj : factoryVoList) {
            //创建一行的方法
            Row row = sheet.createRow(row_column);
            // 给第一列法人编码赋值
            POIClass.toCellValue(row,0, obj.getLegalPersonCode() + "");
            // 给第二列工厂编码赋值
            POIClass.toCellValue(row, 1, obj.getLegalPlantCode() + "");
            // 给第三列工厂描述赋值
            POIClass.toCellValue(row, 2, obj.getLegalPlantDec() + "");
            // 给状态赋值
            POIClass.toCellValue(row, 3, obj.getEnabledName() + "");
        *//*    //给描述赋值
            POIClass.toCellValue(row, 4, obj.getRemark() + "");*//*
            row_column++;
        }
    }*/
}
